package com.heima.apis.wemedia;


import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.admin.dtos.SensitivePageDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;

import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.lang.reflect.InvocationTargetException;

/**
 * @author yht
 * @date 2022/1/13 13:44
 */
@FeignClient(value = "leadnews-wemedia")
public interface IWemediaClient {
    /**
     * 远程调用更改自媒体人的状态
     * @param user
     * @return
     */
    @PostMapping("/api/v1/wemedia/updatestatus")
    public ResponseResult updateStatus(@RequestBody ApUser user);

    /**
     * 查询自动审核失败的文章
     * @return
     */
    @PostMapping("/api/v1/wemedia/findautoauditlose")
    public PageResponseResult findAutoAuditLose(@RequestBody NewsAuthDto newsAuthDto);

    /**
     * 根据id查询文章详情信息
     * @param id
     * @return
     */
    @GetMapping("/api/v1/wemedia/findnewbyid/{id}")
    public ResponseResult findNewById(@PathVariable("id") Integer id);

    /**
     * 文章审核驳回
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/api/v1/wemedia/authfail")
    public ResponseResult authFail(@RequestBody NewsAuthDto newsAuthDto);


    /**
     * 文章审核成功
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/api/v1/wemedia/authpass")
    public ResponseResult authPass(@RequestBody NewsAuthDto newsAuthDto);

    @PostMapping("/api/v1/sens/list")
    public  ResponseResult findbylist(@RequestBody SensitivePageDto sensitivePageDto);
    @PostMapping("/api/v1/sens/del/{id}")
    public  ResponseResult delete(@PathVariable("id")Integer id);
@PostMapping("/api/v1/sens/save")
    public ResponseResult create(@RequestBody WmSensitive wmSensitive) throws InvocationTargetException, IllegalAccessException;
@PostMapping("/api/v1/sens/update")
    public ResponseResult update(@RequestBody SensitiveDto sensitiveDto) throws InvocationTargetException, IllegalAccessException;

    /***
     * 查询频道列表
     * @return
     */
    @GetMapping("/api/v1/channel/list")
    public ResponseResult getChannels();

}
